/* 基础样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

body {
    min-height: 100vh;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    padding: 0;
    margin: 0;
    transition: background-color 0.5s ease;
}

.page-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

header {
    margin-bottom: 30px;
    text-align: center;
    padding-top: 20px;
    position: relative;
}

header h1 {
    font-size: 26px;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 渐变背景 - 不同页面使用不同渐变 */
.login-page {
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
}

.main-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.list-page {
    background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
}

.form-page {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
}

/* 登录页面样式 */
.login-container {
    max-width: 350px;
    margin: 50px auto;
    padding: 40px 30px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.app-logo {
    width: 80px;
    height: 80px;
    background-color: #4a90e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    color: white;
    font-size: 36px;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    width: 20px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

input[type="submit"],
input[type="reset"],
.add-btn,
.back-btn,
.action-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="submit"] {
    flex: 1;
    background-color: #4a90e2;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

input[type="submit"]:hover {
    background-color: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

input[type="reset"] {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
}

input[type="reset"]:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* 错误提示 */
.error-message {
    color: #ff4d4f;
    font-size: 14px;
    margin: 5px 0 15px 0;
    padding: 10px 14px;
    background-color: rgba(255, 235, 235, 0.9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message:before {
    content: "\f06a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* 首页菜单 */
.username {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 20px;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 30px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.15);
}

.menu-icon {
    font-size: 32px;
    margin-bottom: 15px;
    color: #4a90e2;
}

.menu-text {
    font-size: 17px;
    font-weight: 500;
}

.logout-item {
    background-color: rgba(255, 240, 240, 0.9);
}

.logout-item .menu-icon {
    color: #e53e3e;
}

/* 列表页样式 */
.back-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.add-btn {
    display: inline-block;
    background-color: #4a90e2;
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-btn:hover {
    background-color: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.list-container {
    margin-top: 20px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.list-item:hover {
    transform: translateX(4px);
}

.list-info {
    flex: 1;
}

.list-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 17px;
}

.list-password {
    font-size: 14px;
    color: #666;
}

.list-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 8px 12px;
    font-size: 16px;
    text-decoration: none;
    border-radius: 8px;
}

.edit-btn {
    background-color: #4caf50;
    color: white;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.edit-btn:hover {
    background-color: #3d9140;
}

.delete-btn {
    background-color: #f44336;
    color: white;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
}

.delete-btn:hover {
    background-color: #d32f2f;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.empty-state a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
}

/* 适配小屏幕手机 */
@media (max-width: 375px) {
    .page-container {
        padding: 15px;
    }

    header h1 {
        font-size: 22px;
    }

    .menu-item {
        padding: 25px 5px;
    }

    .menu-icon {
        font-size: 28px;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-actions {
        margin-top: 15px;
        width: 100%;
        justify-content: flex-end;
    }
}
